home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-11 | 2.0 KB | 76 lines | [TEXT/CWIE] |
- // HFSTextFolderCorpus.h
- // Copyright: © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
-
- // A corpus implementation for all the text files under a root HFS folder.
-
- #pragma once
- #ifndef HFSTextFolderCorpus_h
- #define HFSTextFolderCorpus_h
-
- #pragma import on
-
- #include "HFSCorpus.h"
-
- #pragma IA_BEGIN_EXPORTS
-
- const uint32 HFSFolderCorpusType = 'HTF1';
-
- class HFSTextFolderCorpus : public HFSCorpus {
- public:
- HFSTextFolderCorpus(uint32 type = HFSFolderCorpusType);
- HFSTextFolderCorpus(short vRef, long rootDirID, uint32 type = HFSFolderCorpusType);
- HFSTextFolderCorpus(StringPtr rootDirPath, uint32 type = HFSFolderCorpusType);
-
- // IACorpus methods
- IADoc* GetProtoDoc();
- IADocIterator* GetDocIterator();
-
- void SetVolumeRefNum (short vrn) { vRefNum = vrn;}
- short GetVolumeRefNum () const {return vRefNum;}
-
- void SetRootDirID(long rootdirid) {rootDirId = rootdirid;}
- long GetRootDirID() const {return rootDirId;}
-
- protected:
- IABlockSize InitialSize();
- void Initializing(IAOutputBlock* output);
- void Opening(IAInputBlock* input);
- IABlockSize UpdateSize();
- void Updating(IAOutputBlock* output);
- private:
- HFSTextFolderCorpus(HFSTextFolderCorpus& fc);
- short vRefNum;
- long rootDirId;
-
- };
-
- class HFSTextFolderDoc : public HFSDoc {
- public:
- HFSTextFolderDoc(HFSTextFolderCorpus* corpus, long dirID, const StringPtr name, long date);
- HFSTextFolderDoc() : HFSDoc() {}
-
- IAStorable* DeepCopy() const;
- IABlockSize StoreSize() const;
- void Store(IAOutputBlock* output) const;
- IAStorable* Restore(IAInputBlock* input) const;
-
- bool LessThan(const IAOrderedStorable* neighbor) const;
- bool Equal(const IAOrderedStorable* neighbor) const;
-
- void SetModDate (long mDate) {modDate = mDate;}
- long GetModDate () const {return modDate;}
-
- protected:
- void DeepCopying(const IAStorable* source);
- void Restoring(IAInputBlock* input, const IAStorable* proto);
- private:
- HFSTextFolderDoc(HFSDoc& fd);
- long modDate;
- };
-
- #pragma IA_END_EXPORTS
-
- #pragma import reset
-
- #endif
-